package cn.mooncode.basketballManage.mapper;

import cn.mooncode.basketballManage.pojo.Playerinfo;
import cn.mooncode.basketballManage.pojo.Team;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jwz
 * @since 2021-03-28
 */
public interface TeamMapper extends BaseMapper<Team> {

    /**
     * 添加教练信息
     * @param cid
     * @param tid
     * @return
     */
    boolean addCoachInfo(Integer cid, Integer tid);

    /**
     * 添加球员信息
     * @param playerinfoList
     * @param tid
     * @return
     */
    boolean addPlayerInfo(List<Playerinfo> playerinfoList, Integer tid);



    /**
     * 获取当前球员信息
     * @param uid
     * @param rid
     * @return
     */
    Team getCurrentTeam(Integer uid, Integer rid);

    /**
     * 获取所有球队信息
     * @param page
     * @param currentPage
     * @param size
     * @return
     */
    IPage<Team> getAllTeams(Page<Team> page, Integer currentPage, Integer size);

    /**
     * 查询本身以外的球队信息
     * @param tid
     * @return
     */
    List<Team> getTeam(Integer tid);

    /**
     * 修改球队获胜次数
     * @param tid
     * @return
     */
    boolean updateWinNum(Integer tid);
}
